home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1994-07-17  |  5.1 KB  |  204 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Processes.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Processes;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __PROCESSES__}
  27. {$SETC __PROCESSES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ProcessesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __EVENTS__}
  40. {$I Events.p}
  41. {$ENDC}
  42. {    Quickdraw.p                                                    }
  43. {        MixedMode.p                                                }
  44. {        QuickdrawText.p                                            }
  45. {    OSUtils.p                                                    }
  46.  
  47. {$IFC UNDEFINED __FILES__}
  48. {$I Files.p}
  49. {$ENDC}
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55. TYPE
  56.     ProcessSerialNumber = RECORD
  57.         highLongOfPSN:            LONGINT;
  58.         lowLongOfPSN:            LONGINT;
  59.     END;
  60.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  61.  
  62.  
  63. CONST
  64. { Process identifier - Various reserved process serial numbers }
  65.     kNoProcess                    = 0;
  66.     kSystemProcess                = 1;
  67.     kCurrentProcess                = 2;
  68.  
  69. { Definition of the parameter block passed to _Launch
  70.     Typedef and flags for launchControlFlags field }
  71.     
  72. TYPE
  73. LaunchFlags = INTEGER;
  74.  
  75.  
  76. CONST
  77. { Definition of the parameter block passed to _Launch }
  78.     launchContinue                = $4000;
  79.     launchNoFileFlags            = $0800;
  80.     launchUseMinimum            = $0400;
  81.     launchDontSwitch            = $0200;
  82.     launchAllow24Bit            = $0100;
  83.     launchInhibitDaemon            = $0080;
  84.  
  85. { Format for first AppleEvent to pass to new process.  The size of the overall
  86.   buffer variable: the message body immediately follows the messageLength }
  87.  
  88. TYPE
  89.     AppParameters = RECORD
  90.         theMsgEvent:            EventRecord;
  91.         eventRefCon:            LONGINT;
  92.         messageLength:            LONGINT;
  93.     END;
  94.     AppParametersPtr = ^AppParameters;
  95.  
  96. { Parameter block to _Launch }
  97.     LaunchParamBlockRec = RECORD
  98.         reserved1:                LONGINT;
  99.         reserved2:                INTEGER;
  100.         launchBlockID:            INTEGER;
  101.         launchEPBLength:        LONGINT;
  102.         launchFileFlags:        INTEGER;
  103.         launchControlFlags:        LaunchFlags;
  104.         launchAppSpec:            FSSpecPtr;
  105.         launchProcessSN:        ProcessSerialNumber;
  106.         launchPreferredSize:    LONGINT;
  107.         launchMinimumSize:        LONGINT;
  108.         launchAvailableSize:    LONGINT;
  109.         launchAppParameters:    AppParametersPtr;
  110.     END;
  111.     LaunchPBPtr = ^LaunchParamBlockRec;
  112.  
  113. { Set launchBlockID to extendedBlock to specify that extensions exist.
  114.  Set launchEPBLength to extendedBlockLen for compatibility.}
  115.  
  116. CONST
  117.     extendedBlock                = $4C43;                        { 'LC' }
  118.     extendedBlockLen            = 32;                            { sizeof(LaunchParamBlockRec) - 12 }
  119.  
  120. { Definition of the information block returned by GetProcessInformation }
  121.     modeDeskAccessory            = $00020000;
  122.     modeMultiLaunch                = $00010000;
  123.     modeNeedSuspendResume        = $00004000;
  124.     modeCanBackground            = $00001000;
  125.     modeDoesActivateOnFGSwitch    = $00000800;
  126.     modeOnlyBackground            = $00000400;
  127.     modeGetFrontClicks            = $00000200;
  128.     modeGetAppDiedMsg            = $00000100;
  129.     mode32BitCompatible            = $00000080;
  130.     modeHighLevelEventAware        = $00000040;
  131.     modeLocalAndRemoteHLEvents    = $00000020;
  132.     modeStationeryAware            = $00000010;
  133.     modeUseTextEditServices        = $00000008;
  134.     modeDisplayManagerAware        = $00000004;
  135.  
  136. { Record returned by GetProcessInformation }
  137.  
  138. TYPE
  139.     ProcessInfoRec = RECORD
  140.         processInfoLength:        LONGINT;
  141.         processName:            StringPtr;
  142.         processNumber:            ProcessSerialNumber;
  143.         processType:            LONGINT;
  144.         processSignature:        OSType;
  145.         processMode:            LONGINT;
  146.         processLocation:        Ptr;
  147.         processSize:            LONGINT;
  148.         processFreeMem:            LONGINT;
  149.         processLauncher:        ProcessSerialNumber;
  150.         processLaunchDate:        LONGINT;
  151.         processActiveTime:        LONGINT;
  152.         processAppSpec:            FSSpecPtr;
  153.     END;
  154.     ProcessInfoRecPtr = ^ProcessInfoRec;
  155.  
  156.  
  157. FUNCTION LaunchApplication(LaunchParams: LaunchParamBlockRec): OSErr;
  158.     {$IFC NOT GENERATINGCFM}
  159.     INLINE $205F, $A9F2, $3E80;
  160.     {$ENDC}
  161. FUNCTION LaunchDeskAccessory(pFileSpec: FSSpec; pDAName: ConstStr255Param): OSErr;
  162.     {$IFC NOT GENERATINGCFM}
  163.     INLINE $3F3C, $0036, $A88F;
  164.     {$ENDC}
  165. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  166.     {$IFC NOT GENERATINGCFM}
  167.     INLINE $3F3C, $0037, $A88F;
  168.     {$ENDC}
  169. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  170.     {$IFC NOT GENERATINGCFM}
  171.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  172.     {$ENDC}
  173. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  174.     {$IFC NOT GENERATINGCFM}
  175.     INLINE $3F3C, $0038, $A88F;
  176.     {$ENDC}
  177. FUNCTION GetProcessInformation(PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  178.     {$IFC NOT GENERATINGCFM}
  179.     INLINE $3F3C, $003A, $A88F;
  180.     {$ENDC}
  181. FUNCTION SetFrontProcess(PSN: ProcessSerialNumber): OSErr;
  182.     {$IFC NOT GENERATINGCFM}
  183.     INLINE $3F3C, $003B, $A88F;
  184.     {$ENDC}
  185. FUNCTION WakeUpProcess(PSN: ProcessSerialNumber): OSErr;
  186.     {$IFC NOT GENERATINGCFM}
  187.     INLINE $3F3C, $003C, $A88F;
  188.     {$ENDC}
  189. FUNCTION SameProcess(PSN1: ProcessSerialNumber; PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  190.     {$IFC NOT GENERATINGCFM}
  191.     INLINE $3F3C, $003D, $A88F;
  192.     {$ENDC}
  193.  
  194. {$ALIGN RESET}
  195. {$POP}
  196.  
  197. {$SETC UsingIncludes := ProcessesIncludes}
  198.  
  199. {$ENDC} {__PROCESSES__}
  200.  
  201. {$IFC NOT UsingIncludes}
  202.  END.
  203. {$ENDC}
  204.